<%= form_for(@employee) do |f| %>
  <% if @employee.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@employee.errors.count, "error") %> prohibited this employee from being saved:</h2>

      <ul>
      <% @employee.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </div>
  
  <div class="field">
	<%= f.label 'Status' %>: (<%= link_to("New Status", new_rank_path, :target =>'_blank') %>)<br />
	<% @ranks.each do |r|%>
		<% checked = !@employee.new_record? && r.id == @employee.rank.id %>
		<%= radio_button_tag 'rank', r.id, checked %>
		<%= r.name %><br />
	<% end %>
  </div>
  
  <div class="field">
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </div>
  <div class="field">
	<%= f.label 'Skills' %>
	<%= link_to "(New Skill)", new_skill_path %><br />
	<% @skills.each do |s|%>
		<%= check_box_tag 'skillset[]', s.id, @emp_skills.include?(s.id) %>
		<%= s.name %><br /> 
	<% end %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
